package cn.tedu.csmall.order.webapi;


import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableDubbo
public class CsmallOrderWebapiApplication {

    public static void main(String[] args) {
        SpringApplication.run(CsmallOrderWebapiApplication.class, args);
    }
    //提供RestTemplate对象，交给Spring容器管理
    @Bean  //通过@Bean实现
    @LoadBalanced
//    开启负载均衡 去注册表里面查询服务信息 自动转换请求路径
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}
